package com.work.model.builder;

import java.util.Date;

import com.work.model.Codereview;
import com.work.model.Project;
import com.work.model.Releases;
import com.work.model.User;

public class CodereviewBuilder extends Builder<Codereview>{

	private CodereviewBuilder withChangeDoc(String changeDoc) {
		build().setChangeDoc(changeDoc);
		return this;
	}
	
	private CodereviewBuilder withCreatedBy(User createdBy) {
		build().setCreatedBy(createdBy);
		return this;
	}
	
	private CodereviewBuilder withCreationDate(Date creationDate) {
		build().setCreationDate(creationDate);
		return this;
	}
	
	private CodereviewBuilder withDesiredDate(Date desiredDate) {
		build().setDesiredDate(desiredDate);
		return this;
	}
	
	private CodereviewBuilder withId(int idCodeReviews) {
		build().setIdCodeReviews(idCodeReviews);
		return this;
	}

	private CodereviewBuilder withProject(Project projectBean) {
		build().setProjectBean(projectBean);
		return this;
	}
	
	private CodereviewBuilder withReleas(Releases releas) {
		build().setReleas(releas);
		return this;
	}
	
	private CodereviewBuilder withResolutionDate(Date resolutionDate) {
		build().setResolutionDate(resolutionDate);
		return this;
	}
	
	private CodereviewBuilder withStatus(String status) {
		build().setStatus(status);
		return this;
	}
	
	private CodereviewBuilder withUpdatedBy(User updatedBy) {
		build().setUpdatedBy(updatedBy);
		return this;
	}
	
	private CodereviewBuilder withUpdatedDate(Date updatedDate) {
		build().setUpdatedDate(updatedDate);
		return this;
	}
	
	public Codereview aCodereview(String changeDoc, User createdBy, Date creationDate, Date desiredDate, int idCodeReviews, Project projectBean, Releases releas, Date resolutionDate, String status, User updatedBy, Date updatedDate) {
		this.withChangeDoc(changeDoc);
		this.withCreatedBy(createdBy);
		this.withCreationDate(creationDate);
		this.withDesiredDate(desiredDate);
		if (0 != idCodeReviews) {
			this.withId(idCodeReviews);
		}
		this.withProject(projectBean);
		this.withReleas(releas);
		this.withResolutionDate(resolutionDate);
		this.withStatus(status);
		this.withUpdatedBy(updatedBy);
		this.withUpdatedDate(updatedDate);		
		return this.build();
	}
}
